//
//  UILabel+Extension.swift
//  weibo002
//
//  Created by 黑眼圈 on 16/4/16.
//  Copyright © 2016年 heiyan. All rights reserved.
//

import UIKit



extension UILabel{
    
    
    
    convenience init(color:UIColor,font:CGFloat,title:String,preferredMaxLayoutWidth:CGFloat = 0) {
        
        //遍历构造函数里一定要用 self
        self.init()
        
        
        self.textColor = color
        self.font = UIFont.systemFontOfSize(font)
        self.textAlignment = .Center
        self.text = title
        
        if preferredMaxLayoutWidth>0 {
            
            self.preferredMaxLayoutWidth = preferredMaxLayoutWidth
            self.numberOfLines = 0
        }
    }
    
    convenience init(color:UIColor,font:CGFloat,preferredMaxLayoutWidth:CGFloat = 0){
        
        //遍历构造函数里一定要用 self
        self.init()
        
        
        self.textColor = color
        self.font = UIFont.systemFontOfSize(font)
        self.textAlignment = .Center
        
        if preferredMaxLayoutWidth>0 {
            
            self.preferredMaxLayoutWidth = preferredMaxLayoutWidth
            self.numberOfLines = 0
        }

    }
    
    
    
    
    
}